package mr.ali.videoapp.portal.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import mr.ali.videoapp.portal.model.CollectionPlayTag;
import mr.ali.videoapp.portal.mapper.CollectionPlayTagMapper;
import mr.ali.videoapp.portal.service.ICollectionPlayTagService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr-ali
 * @since 2025-07-18
 */
@Service
public class CollectionPlayTagServiceImpl extends ServiceImpl<CollectionPlayTagMapper, CollectionPlayTag> implements ICollectionPlayTagService {
@Resource
    private CollectionPlayTagMapper collectionPlayTagMapper;
    @Override
    public CollectionPlayTag collectionPlayTagById(Integer sortId) {
        QueryWrapper<CollectionPlayTag> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("sort_id", sortId);
        return collectionPlayTagMapper.selectOne(queryWrapper);
    }

    @Override
    public List<CollectionPlayTag> collectionPlayTagList() {
        QueryWrapper <CollectionPlayTag> queryWrapper = new QueryWrapper<>();
        return collectionPlayTagMapper.selectList(queryWrapper);
    }
}
